package com.jie.deletefile.Weather;

import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.util.List;

/**
 * Created by 13952137957 on 2016/10/12.
 */
public class parser {


    private static String TAG = "TAG";

    public static Entity.ResultBean.TodayBean gettodayData(String json) {
        Log.e(TAG, "gettodayData: "+json );
        Entity data = null;

        data=new Gson().fromJson(json, new TypeToken<Entity>() {
        }.getType());


        Entity.ResultBean.TodayBean today = data.getResult().getToday();
        Log.e(TAG, "gettodayData: "+today.getDate_y());
        return today;
    }

    public static List<City> getCity(String json) {
        List<City> citys = new Gson().fromJson(json, new TypeToken<List<City>>() {
        }.getType());

        return citys;
    }
}
